import { createApp } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router'
import store from './store'
import i18n from '@/i18n'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import 'element-plus/dist/index.css'
import App from './App.vue'
// 导入全局样式
import './styles/index.scss'
// 导入路由鉴权
import './permission.js'
// 全局属性
import installFilter from '@/filters/index.js'
//引入阿里图标
import '../public/iconfont/iconfont.css'
import '../public/iconfont/iconfont.js'


const app = createApp(App)
installFilter(app)
app.use(ElementPlus, {
  locale: store.getters.language === 'en' ? en : zhCn,
})
app.use(router)
app.use(store)
app.use(i18n)
app.mount('#app')

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}